#ifndef CTIMESYNCHRONIZER_H_
#define CTIMESYNCHRONIZER_H_

#include <stdio.h>

/**
 * CTimeSynchronizer - singleton for time measurement
 * @author Marek Rost
 * @date 28.07.2008
 */
class CTimeSynchronizer {
public:
  ~CTimeSynchronizer();
  double getFrameInterval() const;
  double getFrameTime() const;
  int getFPS() const;
  void update(double time);
  static CTimeSynchronizer* getInstance();
  static void freeInstance();
protected:
  double fps, tmpFps, frameInterval, frameTime, lastTime;
  static CTimeSynchronizer* instance;

  CTimeSynchronizer();
};

#endif
